home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume6 / elm / part04 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  59.2 KB

  1. Subject: v06i029:  Elm mail system (elm), Part04/14
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: Dave Taylor <pyramid!hplabs!hpldat!taylor>
  6. Mod.sources: Volume 6, Issue 29
  7. Archive-name: elm/Part04
  8.  
  9. [  This posting is in a different SHAR format because Dave sent me
  10.    an update to one of the files herein and I had to repack.  --r$ ]
  11.  
  12. #!/bin/sh
  13. # This is a shell archive.  Remove anything before this line,
  14. # then unpack it by saving it in a file and typing "sh file".
  15. # Contents:  doc/ hdrs/ doc/Users.guide doc/elm.1 hdrs/curses.h
  16. #    hdrs/defs.h hdrs/elm.h hdrs/headers.h hdrs/help.h hdrs/sysdefs.h
  17.  
  18. if test ! -d doc
  19. then
  20.   echo creating directory doc
  21.   mkdir doc
  22.   chmod u=rwx,g=rwx,o=rwx doc
  23. fi
  24.  
  25. if test ! -d hdrs
  26. then
  27.   echo creating directory hdrs
  28.   mkdir hdrs
  29.   chmod u=rwx,g=rwx,o=rwx hdrs
  30. fi
  31.  
  32. echo x - doc/Users.guide
  33. sed 's/^XX//' > "doc/Users.guide" <<'@//E*O*F doc/Users.guide//'
  34. XX.PH ""
  35. XX.tm I trust we've run this through tbl first...
  36. XX\"
  37. XX\"  Users guide to the ELM mail system.
  38. XX\"  format with 'tbl Users.guide | troff -mm > Users.fmtd
  39. XX\"  or something similar.
  40. XX\"  (C) Copyright 1985 Dave Taylor
  41. XX\"
  42. XX\"  Last update: May 14th, 1986
  43. XX\"
  44. XX.PF ""
  45. XX\"  Define the big box macro for troff
  46. XX.de eb
  47. XX.sp -1    
  48. XX.nf
  49. XX\h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
  50. XX.fi
  51. XX..
  52. XX.ds HF 3  3 
  53. XX.ds HP 12 12
  54. XX.SA 1
  55. XX.nr Hy 1
  56. XX.nr Pt 1
  57. XX.nr Pi 8
  58. XX.lg 1
  59. XX.HM 1 1
  60. XX.rs
  61. XX.sp 5
  62. XX.ce 99
  63. XX.ps 20
  64. XX\fBElm Users Guide\fR
  65. XX.sp 2
  66. XX.ps 12
  67. XX\fIA painless introduction to electronic mail 
  68. XXusing the \fBElm\fP mailer\fR
  69. XX.sp 5
  70. XXDave Taylor
  71. XX.sp 
  72. XXHewlett-Packard Laboratories
  73. XX1501 Page Mill Road
  74. XXPalo Alto CA
  75. XX94304
  76. XX.sp
  77. XXemail: taylor\s10@\s12hplabs or hplabs!taylor
  78. XX.ps 10
  79. XX.sp 7
  80. XX\fBABSTRACT\fR
  81. XX.ce 0
  82. XX.sp
  83. XX.DS CB F
  84. XXWhile various parts of the Unix system have been
  85. XXupdated into the `CRT' age (rather than the `teletype')
  86. XXthe electronic mail systems haven't.  This document 
  87. XXpresents the \fIElm\fR mail system which remedies
  88. XXthis problem.  This mailer offers all the features of
  89. XX\fI/bin/mail\fR, \fImailx\fR, \fIMail\fR, \fIuumail\fR and \fINmail\fR in an
  90. XXunified and intuitive fashion.
  91. XX.DE
  92. XX.sp 5
  93. XX.ce
  94. XX.ps 18
  95. XX\fB\(co\fR\s12 Copyright 1986 by Dave Taylor
  96. XX.ps 10
  97. XX.SK
  98. XX.ce 99
  99. XX.ps 14
  100. XX\fBElm Users Guide\fR
  101. XX.ps 10
  102. XX.sp
  103. XX(version 1.1)
  104. XX.sp 2
  105. XXDave Taylor
  106. XXHewlett-Packard Laboratories
  107. XX1501 Page Mill Road
  108. XXPalo Alto CA
  109. XX94304
  110. XX.sp
  111. XXemail: taylor@hplabs or hplabs!taylor
  112. XX.sp 2
  113. XX\*(DT
  114. XX.ce 0
  115. XX.nr P 1
  116. XX.PH "'Elm Users Guide''Version 1.1'"
  117. XX.PF "''Page \\\\nP''"
  118. XX.sp 3
  119. XX.H 1 "Introduction"
  120. XX.P 1
  121. XXThe Unix\v'-.3'\s5TM\s10\v'.3' operating system was originally 
  122. XXwritten on a small PDP machine
  123. XXto work with teletypewriters.  Consequently, all the original software for
  124. XXthe operating system was written with a `tty' in mind - they were all 
  125. XXline oriented, rather than screen oriented.
  126. XX.P
  127. XXGradually this began to change, and, with the addition of the Berkeley
  128. XX.I vi
  129. XXvisual shell to the 
  130. XX.I ed
  131. XXline editor, the trend seemed to be brought to the attention of 
  132. XXUnix systems designers.  
  133. XX.FS " "
  134. XXHistorical note: shrewd users will recognize this as the old Unix 
  135. XX.lg 0
  136. XX\fIMsg\fR
  137. XX.lg 1
  138. XXmailer.  The name was changed to avoid a conflict with an old DEC-20
  139. XXmailer, and because the new name stands for \fBEL\fRectronic \fBM\fRail,
  140. XXwhich I think works out better!
  141. XX.FE
  142. XX.P
  143. XXApparently, however, this wasn't enough of a significant event, as
  144. XX.I vi
  145. XXand
  146. XX.I notes
  147. XXare the only screen oriented software available
  148. XX(other than games, which are a taboo subject with managers
  149. XXand the like!).  Consequently, after becoming more and more 
  150. XXdisenchanted
  151. XXwith the existing electronic mail facilities (\fImail\fR
  152. XXand \fImailx\fR, both of which are essentially line editors) I decided
  153. XXto write my own!
  154. XX.P
  155. XXThis document discusses the 
  156. XX.B Elm
  157. XXmailer, and includes a set of example screens and a discussion
  158. XXof configuration (for systems administrators).  It is broken
  159. XXinto three main parts, the \fIElm Users Guide\fR, which you're holding,
  160. XXthe \fIElm Reference Guide\fR, and the \fIElm Alias Users Guide\fR.
  161. XX.P
  162. XXThis guide contains;
  163. XXthis introduction, a session with the mailer, a
  164. XXdiscussion of non-interactive uses of \fBElm\fR,
  165. XXa brief foray into the \fBElm\fR utilities,
  166. XXand finally, credits and references.
  167. XX.P
  168. XXThe \fIElm Reference Guide\fR contains;
  169. XXa discussion of the \fI.elmrc\fR file,
  170. XXstarting options of 
  171. XX.B Elm,
  172. XXoutgoing mail processing,
  173. XXresponses of various commands,
  174. XXthe mail archive file,
  175. XXthe Notes system,
  176. XXthe Alias system,
  177. XXsystem aliases etc,
  178. XXmore on the utilities,
  179. XXand a section for expert users.
  180. XX.P
  181. XXThe \fIElm Alias Users Guide\fR contains;
  182. XXa further discussion of \fIuser aliases\fR
  183. XXand \fIgroup aliases\fR,  System aliases,
  184. XXhow to edit and install new aliases,
  185. XXthe hostname routing database,
  186. XXthe domain routing database,
  187. XXand so on.
  188. XX.P
  189. XXAny comments or problems with any of the documention or the program
  190. XXitself are welcome: all installed systems should have an alias
  191. XXthat will ensure that I receive any mail sent to `elm'.
  192. XX.sp 2
  193. XX.H 1 "The Main System"
  194. XX.P 1
  195. XXUpon entry to the program, the main screen will be 
  196. XXdisplayed as below;
  197. XX\" display start, constant width, remember loc for BOX
  198. XX.DS CB
  199. XX.mk a)
  200. XX.mk a)
  201. XX.ce
  202. XXMailbox is '/usr/mail/mymail' with 15 messages.  [Version 1.1]
  203.  
  204. XX.TS
  205. XXr c r l l l l.
  206. XX ->        1    Apr 3    rob    (24)    Doing anything tonight?
  207. XX        2    Apr 5    Joe    (154)    bug in gammon game
  208. XX        3    Apr 5    root    (13)
  209. XX        4    Apr 6    root    (7)    (continuation of previous message)
  210. XX    U    5    Apr 8    decvax!mouse    (68)    Re: net.music article decvax:495
  211. XX        6    Apr 13    John Jacobs    (194)    How can you hate RUSH?
  212. XX        7    Apr 15    kevin    (27)    More software requests
  213. XX    N    8    Apr 18    games    (26)    Hi there
  214. XX    N    9    Apr 18    Don Knuth    (354)    Your version of TeX...
  215. XX    N    10    Apr 23    Carl Smith    (53)    (More silly stuff
  216. XX    N    11    Apr 24    jad@hpcnoe    (84)    Chico?  Why go there?
  217. XX    N    12    Apr 24    Larry Fenske    (49)    hi there...
  218. XX.TE
  219. XX.sp
  220. XX.ce 3
  221. XX|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  222. XXA)lias, C)hange mailbox, D)elete, E)dit, F)orward, G)roup reply, M)ail, 
  223. XXN)ext, O)ptions, P)rint, R)eply, S)ave, T)ag, Q)uit, U)ndelete, or eX)it
  224. XX                                                            
  225. XXElm : @
  226. XX.sp 2
  227. XX\" draw box, proportional Roman font back, display end
  228. XX.eb
  229. XX.DE
  230. XX.P 0
  231. XXThere are a number of things to notice about this screen;
  232. XX.BL 4
  233. XX.LI
  234. XXFirst off, it's quite possible that on your screen the current message will
  235. XXbe indicated by an inverse bar rather than an arrow. 
  236. XXDon't worry about it - it's just harder to have an inverse
  237. XXbar in a document than an arrow!
  238. XX.LI
  239. XXThe top line always displays the current mail file, 
  240. XXthe number of messages in the file, and the current 
  241. XX.B Elm
  242. XXversion number.
  243. XX.LI
  244. XXThe arrow (``->'') (or bar) always points to the current message.  
  245. XX.LI
  246. XXThe first few characters on each line can indicate the following:
  247. XX.VL 6 5
  248. XX.LI "U"
  249. XX-  an \fIU\fRrgent message
  250. XX.LI "N"
  251. XX-  a \fIN\fRew message since you last read mail
  252. XX.LI "E"
  253. XX-  an \fIE\fRxpired message (not implemented)
  254. XX.LI "A"
  255. XX-  an \fIA\fRction is associated with the message
  256. XX.LI "D"
  257. XX-  the message is marked for \fID\fReletion
  258. XX.LI "+"
  259. XX-  the message is \fITagged\fR.
  260. XX.LE
  261. XX.LI
  262. XXContinuing from left to right, the next field is the message
  263. XXnumber.  For the most part you can ignore these unless you want
  264. XXto quickly move to a specific message (as we'll see later)
  265. XX.LI
  266. XXThe date associated with each message is the date the person
  267. XX.I sent 
  268. XXthe message.  
  269. XX.LI 
  270. XXThe next field displayed indicates who the message is from.  
  271. XX\fBElm\fR will try to display the \fIname\fR of the person who 
  272. XXsent the message, rather than the their return address/login.  
  273. XXSome systems don't generate the correct headers, though, hence 
  274. XXmessages like number 11, where it's
  275. XXthe return address of the sender...
  276. XX.LI
  277. XXThe number in parentheses is the number of lines in the message.
  278. XX.LI
  279. XXThe final field is the (optional) subject of the message.  Note
  280. XXthat message 3 has no subject.
  281. XX.LI
  282. XXA maximum of twelve messages are displayed at one time*.
  283. XX.FS *
  284. XXOn terminals with greater than 25 lines, more messages will be 
  285. XXdisplayed automatically.  
  286. XX.FE
  287. XXFurther into
  288. XXthe document we'll learn how to change 'pages' in the mailbox. 
  289. XX.LI
  290. XXThe three line mini-menu will always 
  291. XXindicate what commands are available at 
  292. XXthe current moment.  
  293. XX.LI
  294. XXFinally, the '@' character indicates where the cursor would be, awaiting
  295. XXyour input.
  296. XX.LE
  297. XX.P 0
  298. XXThe typical action at this point is to use the 
  299. XX.I <return>
  300. XXkey to read the current message.  This particular option actually isn't
  301. XXnoted in the mini-menu, but choosing the '?=help' option will
  302. XXinform you of a number of choices other than those in the 
  303. XXbasic menu!
  304. XX.P 0
  305. XXPressing this key will clear the screen and display the 
  306. XXmessage using the local pager 
  307. XX(see \fIpager\fR in the \fI.elmrc\fR file).
  308. XX.P 0
  309. XXWhile reading is perhaps the most fundamental function that the
  310. XX.B Elm
  311. XXprogram performs, there are a number of other options available,
  312. XXnamely;
  313. XX\" ensure we get a reasonable chunk of this table on the page...
  314. XX.ne 10
  315. XX.sp
  316. XX.VL 25 0 1
  317. XX.LI "Command"
  318. XXAction
  319. XX.LE
  320. XX.sp
  321. XX.VL 22 3 1
  322. XX.LI "|"
  323. XXPipe current message or tagged messages to specified system command.
  324. XX.LI "!"
  325. XXShell escape.
  326. XX.LI "?"
  327. XXHelp mode - any key pressed will be explained.
  328. XX.LI "+, <space>,"
  329. XX.LI "  or <NEXT>"
  330. XXNext page of headers
  331. XX.LI "-, or <PREV>"
  332. XXPrevious page of headers
  333. XX.LI "=, or <HOME>"
  334. XXSet current message to 1
  335. XX.LI "*, or "
  336. XX.LI " <SHIFT>-<HOME>"
  337. XXSet current to last message.
  338. XX.LI "<n>"
  339. XXSet current message to number n.
  340. XX.LI "/"
  341. XXSearch for pattern in subject/from lines.
  342. XX.LI "//"
  343. XXSearch for pattern in entire mailbox.
  344. XX.LI "<"
  345. XXScan message for calendar entries*
  346. XX.FS *
  347. XXSome sites might opt not to have this feature
  348. XXavailable.
  349. XX.FE
  350. XX.LI ">"
  351. XXA synonym for `s' - \fIsave\fR message or messages.
  352. XX.sp
  353. XX.LI "a"
  354. XXAlias, change to 'alias' mode 
  355. XX.LI "b"
  356. XXBounce - remail message**
  357. XX.LI "c"
  358. XXChange to new mail file
  359. XX.LI "d"
  360. XXDelete current message
  361. XX.LI "<control>-D"
  362. XXDelete all messsages matching specified pattern
  363. XX.LI "e"
  364. XXEdit mailbox file, resyncing upon reentry.
  365. XX.LI "f"
  366. XXForward message to specified user**
  367. XX.FS **
  368. XXThe difference between \fIForward\fR and \fIBounce\fR is rather 
  369. XXsubtle -- a forwarded message is ``from'' you, with the
  370. XXoriginal message included, whereas a bounced message
  371. XXis still from the original sender.  
  372. XX.FE
  373. XX.LI "g" 
  374. XXGroup reply - reply to everyone who received the current message
  375. XX.LI "h"
  376. XXDisplay message + headers
  377. XX.LI "j"
  378. XXIncrement current message by one
  379. XX.LI "k"
  380. XXDecrement current message by one
  381. XX.LI "m"
  382. XXMail to arbitrary user(s)
  383. XX.LI "n or <return>"
  384. XXNext message (Read current, then increment)
  385. XX.LI "o"
  386. XXAlter current system options.
  387. XX.LI "p"
  388. XXPrint current message or tagged messages.
  389. XX.LI "r"
  390. XXReply to the author of current message
  391. XX.LI "s"
  392. XXSave current message or tagged messages to file
  393. XX.LI "t"
  394. XXTag current message.
  395. XX.LI "<control>-T"
  396. XXTag all messages matching specified pattern.
  397. XX.LI "q"
  398. XXQuit - mail deleted, saved in mbox or left.
  399. XX.LI "u"
  400. XXUndelete current message
  401. XX.LI "x"
  402. XXExit - don't record as read, don't save...
  403. XX.sp
  404. XX.LI "^L"
  405. XXRewrite screen.
  406. XX.LI "^M (<return>)"
  407. XXRead current message
  408. XX.LI "^Q, DEL"
  409. XXExit - don't record as read, don't save...
  410. XX.LE
  411. XX.sp
  412. XX.P 0
  413. XXThat are all the commands available at the main level of the
  414. XX.B Elm
  415. XXprogram!  Easy to remember, right?
  416. XX.sp 2
  417. XX\" again, make sure we start on a new page please
  418. XX.ne 10
  419. XX.P 0
  420. XXAs an example, let's enter a series of commands and indicate
  421. XXwhat the display would be after each one;
  422. XX.sp
  423. XX.P 0
  424. XXFirst off, let's go to the next page of mail with `\fI+\fR';
  425. XX.DS CB
  426. XX.mk a)
  427. XX.ce
  428. XXMailbox is '/usr/mail/mymail' with 15 messages.  [Version 1.1]
  429.  
  430. XX.TS
  431. XXr c r l l l l.
  432. XX ->    N    13    Apr 3    Jack    (17)    Wanna buy some albums cheap?
  433. XX    N    14    Apr 5    Jack    (8)    Cancel the previous offer!
  434. XX    N    15    Apr 5    sdcsvax!dx    (420)    Moving day (long) 
  435. XX.TE
  436. XX     
  437. XX  
  438. XX     
  439. XX     
  440. XX  
  441. XX  
  442. XX  
  443. XX  
  444. XX  
  445.  
  446. XX.ce 3
  447. XX|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern 
  448. XXA)lias, C)hange mailbox, D)elete, E)dit, F)orward, G)roup reply, M)ail
  449. XXN)ext, O)ptions, P)rint, R)eply, S)ave, T)ag, Q)uit, U)ndelete, or eX)it
  450. XX                                                            
  451. XXElm : @
  452. XX.sp 2
  453. XX.eb
  454. XX.DE
  455. XX.P 0
  456. XXLet's read the new current message, 13, by typing <\fIreturn\fR>.
  457. XX.DS CB
  458. XX.mk a)
  459. XX.tl 'Message #13 from Jack''Mailed April 3, 1985 at 8:45 pm'
  460.  
  461. XXHey Dave! I've got some old AC/DC and KISS albums, and as I know
  462. XXyou are a collector, do you want to buy them off of me before
  463. XXI make ashtrays out of them (or frisbees...)?
  464.  
  465. XX                        Humourously,
  466. XX                                        Jack 
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475. XXMore: @
  476. XX.eb
  477. XX.DE
  478. XX.P 0
  479. XXNeedless to say, we can't let this message go by without replying!
  480. XXSo let's press <\fIreturn\fR> to return to the main menu, 
  481. XXthen use the
  482. XX.I "reply"
  483. XXcommand to respond.
  484. XX.P 0
  485. XXAfter pressing the `\fIr\fR' key, the program asks if a copy of the 
  486. XXmessage is desired (the character under the cursor indicates the
  487. XXdefault if <return> is pressed.  In this case, the default is 'no');
  488. XX.sp
  489. XX.nf
  490. XX    copy message? (y/n) @
  491. XX.fi
  492. XX.P 0
  493. XXWe choose to answer no, so press the `\fIn\fR' key.  Next 
  494. XX.B Elm
  495. XXverifies that the subject is okay;
  496. XX.sp
  497. XX.nf
  498. XX    Subject: Re: Wanna buy some albums cheap?@
  499. XX.fi
  500. XX.sp
  501. XXTyping anything other than <return> will allow us
  502. XXto change the subject to something more appropriate.
  503. XXWe decide, however, to leave it be and press <\fIreturn\fR> again.
  504. XX.sp
  505. XXFinally, we're asked if we want to send copies of this
  506. XXmessage to anyone.  We don't, so we press <\fIreturn\fR> one
  507. XXmore time.
  508. XX.P 0
  509. XXThe program then puts us
  510. XXin the
  511. XX.I vi
  512. XXeditor with a newly created file.
  513. XX.P 0
  514. XXAfter having entered a suitable reply, and left the editor,
  515. XXthe 
  516. XX.B Elm
  517. XXsystem then verifies that we really want to send the message with;
  518. XX.sp
  519. XX    Are you sure you want to send this message? (y/n) @
  520. XX.sp
  521. XXTo which the response is `\fIy\fR' for 'yes'.  It then sends the message off
  522. XXto Jack, who will receive it hopefully quite soon (or at least
  523. XXbefore he makes ashtrays out of the albums!)  (we'll ignore the
  524. XXnext message, which seems to be relevent, because these little 
  525. XXdisplays are eating up space in this document anyway!!)
  526. XX.sp
  527. XX.P 0
  528. XXMessage 13 is still the current message,
  529. XXso, now let's save it and the one after it from Jack, message 14,
  530. XXby \fItagging\fR them both.  We press `\fIt\fR' for \fItag\fR, which 
  531. XXputs the '+' tag indicator on this message, move to the next
  532. XXmessage with the `\fIj\fR' key, then press `\fIs\fR' for \fIsave\fR*
  533. XX.FS *
  534. XXAnother subtle note: operations that work with tagged messages also
  535. XXalways work with the current message, so we don't need to actually
  536. XX\fItag\fR message 14.
  537. XX.FE
  538. XXThis prompts for the file to save to;
  539. XX.nf
  540.  
  541. XX   Save messages to: @
  542.  
  543. XX.fi
  544. XXto which we answer \fIjack\fR.  The two messages are then saved to
  545. XXthe specified file, marked for deletion, and the \fItags\fR are
  546. XXremoved from them.
  547. XX.P 0
  548. XXThe screen is now;
  549. XX.DS CB
  550. XX.mk a)
  551. XX.ce
  552. XXMailbox is '/usr/mail/mymail' with 15 messages.  [Version 1.1]
  553. XX.nf
  554.  
  555. XX.TS
  556. XXr c r l l l l.
  557. XX ->    \ D    13    Apr 3    Jack    (17)    Wanna buy some albums cheap?
  558. XX    \ D    14    Apr 5    Jack    (8)    Cancel the previous offer!
  559. XX    N    15    Apr 5    sdcsvax!dx    (420)    Moving day (long) 
  560. XX.TE
  561. XX.sp 10    
  562. XX.ce 3
  563. XX|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  564. XXA)lias, C)hange mailbox, D)elete, E)dit, F)orward, G)roup reply, M)ail, 
  565. XXN)ext, O)ptions, P)rint, R)eply, S)ave, T)ag, Q)uit, U)ndelete, or eX)it
  566. XX                                                            
  567. XXElm : @
  568. XX.sp 2
  569. XX.eb
  570. XX.DE
  571. XX.P 0
  572. XXNow lets go back to the first page of messages by typing '\fI=\fR';
  573. XX.DS CB
  574. XX.mk a)
  575. XX.ce
  576. XXMailbox is '/usr/mail/mymail' with 15 messages.  [Version 1.1]
  577. XX.nf
  578.  
  579. XX.TS
  580. XXr c r l l l l.
  581. XX ->        1    Apr 3    rob    (24)    Doing anything tonight?
  582. XX        2    Apr 5    Joe    (154)    bug in gammon game
  583. XX        3    Apr 5    root    (13)
  584. XX        4    Apr 6    root    (7)    (continuation of previous message)
  585. XX    U    5    Apr 8    decvax!mouse    (68)    Re: net.music article decvax:495
  586. XX        6    Apr 13    John Jacobs    (194)    How can you hate RUSH?
  587. XX        7    Apr 15    kevin    (27)    More software requests
  588. XX    N    8    Apr 18    games    (26)    Hi there
  589. XX    N    9    Apr 18    Don Knuth    (354)    Your version of TeX...
  590. XX    N    10    Apr 23    Carl Smith    (53)    (More silly stuff
  591. XX    N    11    Apr 24    jad@hpcnoe    (84)    Chico?  Why go there?
  592. XX    N    12    Apr 24    Larry Fenske    (49)    hi there...
  593. XX.TE
  594. XX.sp
  595. XX.ce 3
  596. XX|=pipe, !=shell, ?=help, <n>=set current to n, /=search pattern
  597. XXA)lias, C)hange mailbox, D)elete, E)dit, F)orward, G)roup reply, M)ail, 
  598. XXN)ext, O)ptions, P)rint, R)eply, S)ave, T)ag, Q)uit, U)ndelete, or eX)it
  599. XX                                                            
  600. XXElm : @
  601. XX.sp 2
  602. XX.eb
  603. XX.DE
  604. XX.P 0
  605. XXGee..note five not only looks mildly interesting but it's an 
  606. XX\fBU\fRrgent message too!  So 
  607. XXlet's read it by typing \fI5<return>\fR
  608. XXto make that the current message, and press <\fIreturn\fR> again
  609. XXto read it.  After reading
  610. XXthe message we decide that it's utterly worthless, not even worth
  611. XXreplying to, let alone saving, so we'll mark it
  612. XXfor future deletion with the `d' \fIdelete\fR key.
  613. XX.P 0
  614. XXA `D' is put next to the message now...
  615. XX.P 0
  616. XXBefore we finish up, we suddenly remember that one of the 
  617. XXmessages was supposed to be about how to write decent 
  618. XXdocumentation for Unix software, so let's try to find it...
  619. XX.P 0
  620. XXFirst off, we'll move back to message one with the `\fI=\fR'
  621. XXkey and then use the `/' \fIpattern matching\fR command:
  622. XX.nf
  623.  
  624. XX    Elm : Pattern                   / = match anywhere in messages
  625. XX    Match pattern: @
  626.  
  627. XX.fi
  628. XXwe'll type in \fIdocument\fR (it's case insensitive) and see if the system 
  629. XXcan find it.  After a brief second or two it returns 'pattern not found.'
  630. XXHmm...maybe it's not either the from or the subject of
  631. XXany of the messages...In case that's true, let's try using 
  632. XXthe \fImatch anywhere in message\fR command;
  633. XX.P 0
  634. XXWe again type `/' for \fIpattern matching\fR;
  635. XX.nf
  636.  
  637. XX    Elm : Pattern                      / = match anywhere in messages
  638. XX    Match pattern: @
  639.  
  640. XX.fi
  641. XXAnd now we'll use `/' again to get the match anywhere in file
  642. XXoption.  Now the bottom of the screen looks like;
  643. XX.nf
  644.  
  645. XX    Elm : Pattern                     / = match anywhere in messages
  646. XX    Match pattern (in entire mailbox): @
  647.  
  648. XX.fi
  649. XXto which we respond \fIdocument\fR again.  
  650. XX.P 0
  651. XXThe mailer then searches through each line of all the messages in 
  652. XXthe file and moves the current message pointer to message 
  653. XXnumber 7.  A quick check reveals that this message indeed
  654. XXcontains the word `document', but it's not the one we want,
  655. XXso we're going to just get outta here!
  656. XX.P 0
  657. XXWe've had enough mail for today, so lets quit, leaving
  658. XXall the mail in the incoming mailbox, except those few we've
  659. XXmarked for deletion;
  660. XX.sp
  661. XX.I Quit
  662. XXprompts;
  663. XX.sp
  664. XX.nf
  665. XX   Delete messages? (y/n) @
  666. XX.fi
  667. XX.sp
  668. XXto which we answer `\fIy\fR' for yes.  The next prompt is then;
  669. XX.sp
  670. XX.nf
  671. XX   Keep mail in incoming mailbox? (y/n) @
  672. XX.fi
  673. XX.sp
  674. XXto which we also answer yes...the program then quickly saves
  675. XXthe files, removing message 5, 13 and 14 as it goes along, and exits.
  676. XX.sp 2
  677. XX.P 0
  678. XXAs you can see, the program is pretty easy to use!  In fact, it was
  679. XXdesigned to be used without this documentation at all, so you 
  680. XXcould toss this right now (but don't - think of the tree that 
  681. XXsacrificed it's precious life to allow this printout!)
  682. XX.sp 2
  683. XX.H 1 "Non-Interactive Uses of Elm"
  684. XX.P 1
  685. XXBefore we discuss the \fBElm\fR utilities, it's worth noting that 
  686. XXthere are a couple of other ways to use the main mail
  687. XXsystem, namely to 'send only' and to send files (batchmail).
  688. XX.P
  689. XXTo send a message to someone without any of the associated 
  690. XXoverhead of the main system being loaded, you can invoke the
  691. XXmailer with the name(s) of the people to send to.  The 
  692. XXmailer will then prompt for Subject, Copies, and then drop
  693. XXyou in your editor (defined in the ".elmrc" file) to compose
  694. XXthe message.   When composition is complete, the program 
  695. XXverifies transmission then terminates.  For example;
  696. XX.nf
  697.  
  698. XX  $ \fBelm dave_taylor\fR
  699. XX  To: hplabs!taylor
  700. XX  Subject: \fBthis is a test\fR
  701. XX  Copies To: \fB<return>\fR
  702.  
  703. XX  <invokes editor, message composed, then>
  704.  
  705. XX  Are you sure you want to send this? (y/n) \fBy\fR
  706.  
  707. XX  mail sent.
  708.  
  709. XX  $
  710.  
  711. XX.fi
  712. XXNote that the user input is in \fBbold\fR face, so you can see that
  713. XXthe mailer verified the alias expansion too!
  714. XX.sp
  715. XX.P
  716. XXThe mailer also supports batch type mailing, of files and so on,
  717. XXby using the following starting sequence;
  718. XX.nf
  719.  
  720. XX  $ \fBelm -s "File help.c" dave_taylor < help.c\fR
  721.  
  722. XX.fi
  723. XXwhich will read in the file and transmit it to the specified user
  724. XXwith the specified subject.  Note that the program is intelligent
  725. XXenough to check to see what the standard input is from this 
  726. XXinvocation, so a command of the form
  727. XX.nf
  728.  
  729. XX  $ \fBelm -s "file help.c" dave_taylor\fR
  730.  
  731. XX.fi
  732. XXwould result in the following sequence since the program is reading
  733. XXthe "standard in" for information;
  734. XX.nf
  735.  
  736. XX  $ \fBelm -s "file help.c" dave_taylor\fR
  737. XX  To: hplabs!taylor
  738. XX  Subject: file help.c
  739.  
  740. XX  Enter your message, ending with ^D
  741.  
  742. XX  \fBthis is the message
  743. XX  Please don't ask me why I used this wierd mode!
  744.  
  745. XX  ^D\fR
  746. XX  <end-of-message>
  747.  
  748. XX  $
  749.  
  750. XX.fi
  751. XXwhich is reasonable behaviour!!  (not only that, but this is 
  752. XXalmost exactly what \fI/bin/mail\fR does in the same situation!!)
  753. XX.sp 2
  754. XX.H 1 "The Elm Utilities"
  755. XX.sp
  756. XX.P
  757. XXThe \fBElm\fR program is really much more than a single
  758. XXprogram for reading and writing mail.  It's a unified 
  759. XXenvironment for intelligently dealing with electronic
  760. XXmail.  As a consequence, it contains a number of other
  761. XXprograms to aid in the easy processing of email, 
  762. XXincluding the following pieces;
  763. XX.VL 14 2
  764. XX.LI "checkalias"
  765. XXA script that contains the line \fBelm -c \$*\fR.
  766. XX.LI "newalias"
  767. XXThis program installs new aliases - please see the 
  768. XX\fIElm Alias Users Guide\fR for more information.
  769. XX.LI "newmail"
  770. XXThis program is designed to be put into `background' and then
  771. XXmonitors your incoming mailbox for new mail.  Whenever you
  772. XXreceive new mail, the program will asynchronously write to the
  773. XXscreen a notification, including whom the new mail is from and 
  774. XXwhat the subjects of the messages are.  The output looks like;
  775. XX.DS
  776. XXNew mail has arrived;
  777.  
  778. XXFrom Jimmy Carter - Urgent matters of state
  779. XXFrom joe@ucbvax.arpa - Did I hear someone say PARTY??
  780. XX.DE
  781. XXThis is quite helpful for deciding in `real time' whether it's
  782. XXnecessary to read the mail immediately or not.
  783. XX.LI "wnewmail"
  784. XXThis is extremely similar to \fInewmail\fR but is 
  785. XXslightly modified to run in a windowing environment.
  786. XXThe differences are that it stays in `foreground' (thereby
  787. XXtaking over a window entirely), and outputs for new 
  788. XXmail in a slightly more succint format;
  789. XX.DS
  790. XXMail from Jimmy Carter -- Urgent matters of state
  791. XXMail From joe@ucbvax.arpa -- Did I hear someone say PARTY??
  792. XX.DE
  793. XX.LI "readmsg"
  794. XXThis handy little program can be used in two ways...first off,
  795. XXit can be used to easily read a specific message in the
  796. XXincoming mailbox, specified by ordinal number, by a string that
  797. XXthe message contains, or by the metacharacter `$' which 
  798. XXrepresents the last message in the mailbox.
  799. XX.P 0
  800. XXFor example;
  801. XX.DS
  802. XX$ \fBreadmsg 4 5 9 | lpr\fR
  803. XX.DE 
  804. XXwould generate a printout, \fIsans\fR headers, of the fourth,
  805. XXfifth and ninth messages in your mailbox.
  806. XX.DS
  807. XX$ \fBreadmsg Carter | page\fR
  808. XX.DE
  809. XXwould be a fast way to read what `ole Jimmy has to say...
  810. XXand
  811. XX.DS
  812. XX$ \fBreadmsg -h hear someone say\fR
  813. XX.DE
  814. XXwould list, including the message headers, the message
  815. XXcontaining the string ``hear someone say''.
  816. XX.LI "from"
  817. XXSimilar to the Berkeley \fIfrom\fR command, this will
  818. XXgive you a ``table of contents'' of either the current
  819. XXmailbox or a mailbox of your choice.   It's useful to
  820. XXsee what mail is pending, or what's in a mailbox.
  821. XX.LI "printmail"
  822. XXThis is a formatting routine that knows that mailboxes look
  823. XXlike and inserts either formfeeds or dashed lines between
  824. XXmessages.  It can be used in either of two ways - either 
  825. XXa mailbox file can be \fIpiped\fR to it or it can be given
  826. XXa list of mailbox file names to format.  The only option
  827. XXon the program is `-d' which indicates that you want to have
  828. XXa dashed line separating messages rather than a formfeed.
  829. XX.P 0
  830. XXFor example;
  831. XX.DS
  832. XX$ \fBprintmail -d | lpr\fR
  833. XX.DE
  834. XXwill print out your current incoming mailbox, separating the messages
  835. XXby a dashed line.
  836. XX.DS
  837. XX$ \fBreadmsg 3 4 10 | printmail | lpr\fR
  838. XX.DE
  839. XXwill print messages 3, 4, and 10 from your incoming mailbox,
  840. XXseparated by formfeeds (that is, each message will start on it's
  841. XXown page).
  842. XX.P 0
  843. XXFinally,
  844. XX.DS
  845. XX$ \fBprintmail ~/mbox ~/Mail/mail.sent | lpr\fR
  846. XX.DE
  847. XXwill print all the messages saved in \fImbox\fR and in your \fImail.sent\fR
  848. XXfiles.  The second file will be started on a new page regardless of
  849. XXthe presence or absence of the `-d' dashed line option.
  850. XX.LI "newalias"
  851. XXThis is used to install new user/group aliases.  Please see the
  852. XX\fIElm Alias Users Guide\fR for further information on this!
  853. XX.LI "fastmail"
  854. XXSometimes you want to have a batchmailing system that works as
  855. XXquickly as possible, not bothering with aliases or any of the
  856. XXother ``deluxe'' features of \fBElm\fR.  An example of this would
  857. XXbe if you have a large mailing list for a newsletter, say.
  858. XXThis command, \fIfastmail\fR, is designed just for that purpose.
  859. XXIt avoids the lengthy startup time of \fBElm\fR while still
  860. XXgenerating valid \fIRFC-822\fR* mail.
  861. XX.FS *
  862. XXIf you don't know what RFC-822 is, don't worry about it!
  863. XX.FE
  864. XXPlease see the `man' entry for more information on this
  865. XXcommand (use \fBman fastmail\fR after installation).
  866. XX.LE
  867. XX.sp 3
  868. XX.H 1 "Credits and So on"
  869. XX.P
  870. XXThis mailer has been evolving over the past year or so with
  871. XXinvaluable comments on the interface and general mail 
  872. XXissues from the following people;
  873. XXWalter Underwood, Larry Fenske, Rob Sartin,
  874. XXJohn Dilley (who got the SPECTRUM version checked out, too!) and Carl DierschowX.
  875. XX.sp
  876. XXFor the Berkeley implementation, lots of help came from
  877. XXJohn Lebovitz and Ken Stone.
  878. XX.sp
  879. XXFor the Amdahl/UTS implementation, thanks to Scott McGregor and
  880. XXStan Isaacs.
  881. XX.sp
  882. XXFor the Sun problems, Dave England in Lancaster (UK) turned out to be
  883. XX``bloody useful'', as he would no doubt say.
  884. XX.sp
  885. XXThe Pyramid version is due to the work of Steve Malone
  886. XXof the University of Washington.
  887. XX.sp
  888. XXA few others have been amazingly disciplined at reporting problems
  889. XXand (usually, much to my relief) indicating the fixes needed,
  890. XXnamely Guy Hillyer and Bruce Townsend. 
  891. XX.sp
  892. XXThere have been many, many others, too numerous to mention, that
  893. XXhave inspired me with questions like "Why can't Elm..." or 
  894. XX"Why does it ..." or "Can we make it..." too.  
  895. XX.sp
  896. XXAlso helpful was the ability to have my `own' machine to 
  897. XXclose up the many many iterative loops that this software
  898. XXhas gone through - since being on a big multi-user machine
  899. XXtends to slow it down to a standstill...
  900. XXFor that, I thank HP Colorado Networks Division for their 
  901. XXsupport, and now HP Labs for the wonderful working environment
  902. XXthat I have here (more than any one person is safe having!)
  903. XX.P
  904. XXFinally, it's also been a very useful experience overall,
  905. XXconfirming my beliefs that iterative software design and
  906. XXkeeping a close watch on users (not to mention an open
  907. XXmind and mailbox!) improves a product manyfold.
  908. @//E*O*F doc/Users.guide//
  909. chmod u=rw,g=r,o=r doc/Users.guide
  910.  
  911. echo x - doc/elm.1
  912. sed 's/^XX//' > "doc/elm.1" <<'@//E*O*F doc/elm.1//'
  913. XX.TH ELM 1L 
  914. XX.ad b
  915. XX.SH NAME
  916. XXelm - an interactive mail system
  917. XX.SH SYNOPSIS
  918. XX.B elm
  919. XX[
  920. XX.B \-achkmrswz
  921. XX] [
  922. XX.B \-f
  923. XX<
  924. XX.B file
  925. XX>] [
  926. XX.B \-d
  927. XX<
  928. XX.B level
  929. XX>]
  930. XX.br
  931. XX.B elm 
  932. XX[
  933. XX.B \-S 
  934. XX<
  935. XX.B subject
  936. XX>] <
  937. XX.B "list of aliases or addresses"
  938. XX>
  939. XX.PP
  940. XX.SH HP-UX COMPATIBILITY
  941. XX.TP 10
  942. XXLevel:
  943. XXHP-UX/STANDARD
  944. XX.TP
  945. XXOrigin:
  946. XXHewlett-Packard
  947. XX.SH DESCRIPTION
  948. XX.I Elm\^
  949. XXis a new interactive mailer program that supercedes 
  950. XX.I mail
  951. XXand 
  952. XX.I mailx.
  953. XX.PP
  954. XXThere are three main ways to use the \fBelm\fR mailer; 
  955. XXone way to use the mailer is to specify a list of addresses on the
  956. XXcommand line when the mailer is invoked.  This will allow sending
  957. XXof a single message to the specified recipients with all the
  958. XXoptions usually available in the \fBelm\fR system itself.
  959. XX.PP
  960. XXThe second way, used most commonly when transmitting files and such,
  961. XXis to specify the subject of the message and the recipients using
  962. XXthe command line and redirect a file as standard input.  For example,
  963. XXthe command 
  964. XX.nf
  965.  
  966. XX    elm -s testing joe < test.c 
  967.  
  968. XX.fi
  969. XXwould mail a copy of the
  970. XXfile test.c to alias joe, with the subject "testing" indicated.
  971. XX.PP
  972. XXOtherwise, the starting options are;
  973. XX.TP 1.0i
  974. XX.B "-a"
  975. XXArrow - force the arrow cursor (instead of the inverse bar)
  976. XX.B "-c"
  977. XXCheckalias - expand the following aliases and return.
  978. XX.B "-d <level>"
  979. XXDebug - set specified debug level - Output to "$HOME/Elm:debug.info"
  980. XX.TP
  981. XX.B "-f <file>"
  982. XXFile - read file (specified) rather than the incoming mailbox.
  983. XX.TP
  984. XX.B "-h"
  985. XXHelp - give a list of starting options.
  986. XX.TP
  987. XX.B "?"
  988. XXSynonymous with the "-h" option.
  989. XX.TP
  990. XX.B "-k"
  991. XXKeypad - force knowledge of HP terminal keyboard, to allow
  992. XXthe use of the NEXT, PREV and HOME/SHIFT-HOME keys.
  993. XX.TP
  994. XX.B "-K"
  995. XXKeypad + softkeys - enable use of softkeys on HP terminals only.
  996. XX.TP
  997. XX.B "-m"
  998. XXMenu off - Use the extra lines for more message headers.
  999. XX.TP
  1000. XX.B "-s"
  1001. XXSubject - specify subject for message to mail.
  1002. XX.TP
  1003. XX.B "-z"
  1004. XXZero - don't enter \fBElm\fR if no mail is pending.
  1005. XX.SH AUTHOR
  1006. XXDave Taylor, Hewlett-Packard Laboratories
  1007. XX.SH SEE ALSO
  1008. XX.I "Elm Users Guide", 
  1009. XXby Dave Taylor
  1010. XX.sp
  1011. XX.br
  1012. XX.I "Elm Reference Guide"
  1013. XXby Dave Taylor
  1014. XX.sp 
  1015. XX.br
  1016. XX.I "Elm Alias Users Guide"
  1017. XXby Dave Taylor
  1018. XX.sp 
  1019. XX.br
  1020. XXnewalias(1L), checkalias(1L), mail(1), mailx(1), from(1L), printmail(1L)
  1021. XX.SH FILES
  1022. XX/usr/local/bin/elm-help.main      help file
  1023. XX.br
  1024. XX/usr/mail/.alias_hash             system alias hash table
  1025. XX.br
  1026. XX/usr/mail/.alias_data             system alias data table
  1027. XX.br
  1028. XX$home/.alias_hash                 user alias hash table
  1029. XX.br
  1030. XX$home/.alias_data                 user alias data table
  1031. XX.br
  1032. XX/tmp/snd*                         outgoing mail edit buffer
  1033. XX.br
  1034. XX/tmp/mbox*                        temporary mailbox
  1035. XX.br
  1036. XX$HOME/ELM:debug.info              Debug output if turned on
  1037. XX.SH DIAGNOSTICS
  1038. XXShould know about keyboards/softkey terminals other than HP.  (If only 
  1039. XXtermcap were that powerful!)
  1040. @//E*O*F doc/elm.1//
  1041. chmod u=rw,g=r,o=r doc/elm.1
  1042.  
  1043. echo x - hdrs/curses.h
  1044. sed 's/^XX//' > "hdrs/curses.h" <<'@//E*O*F hdrs/curses.h//'
  1045. XX/***             curses.h            ***/
  1046.  
  1047. XX/*** (C) Copyright 1986 Dave Taylor            ***/
  1048.  
  1049. XX     /*** Include file for seperate compilation.  ***/
  1050.  
  1051. XX#define OFF        0
  1052. XX#define ON         1
  1053.  
  1054. XXint  InitScreen(),      /* This must be called before anything else!! */
  1055.  
  1056. XX     ClearScreen(),      CleartoEOLN(),
  1057.  
  1058. XX     MoveCursor(),
  1059. XX     CursorUp(),         CursorDown(), 
  1060. XX     CursorLeft(),       CursorRight(), 
  1061.  
  1062. XX     StartBold(),        EndBold(), 
  1063. XX     StartUnderline(),   EndUnderline(), 
  1064. XX     StartHalfbright(),  EndHalfbright(),
  1065. XX     StartInverse(),     EndInverse(),
  1066. XX    
  1067. XX     transmit_functions(),
  1068.  
  1069. XX     Raw(),              ReadCh();
  1070.  
  1071. XXchar *return_value_of();
  1072. @//E*O*F hdrs/curses.h//
  1073. chmod u=rw,g=r,o=r hdrs/curses.h
  1074.  
  1075. echo x - hdrs/defs.h
  1076. sed 's/^XX//' > "hdrs/defs.h" <<'@//E*O*F hdrs/defs.h//'
  1077. XX/**        defs.h            **/
  1078.  
  1079. XX/**  define file for ELM mail system.  **/
  1080.  
  1081. XX/**  (C) Copyright 1985 Dave Taylor    **/
  1082.  
  1083. XX#include "sysdefs.h"    /* system/configurable defines */
  1084.  
  1085. XX#define VERSION        "1.1" /* Version number!  WHAT_STRING should agree */
  1086.  
  1087. XX#define WHAT_STRING    "@(#) Version 1.1, initial release - June 1986"
  1088.  
  1089. XX#define SLEN        256        /* long for ensuring no overwrites... */
  1090. XX#define SHORT        5        /* super short strings!          */
  1091. XX#define NLEN        20        /* name length for aliases            */
  1092. XX#define SHORT_SLEN      40
  1093. XX#define STRING        100    /* reasonable string length for most..      */
  1094. XX#define LONG_SLEN    250    /* for mail addresses from remote machines! */
  1095. XX#define LONG_STRING    500    /* even longer string for group expansion   */
  1096. XX#define VERY_LONG_STRING 2500    /* huge string for group alias expansion    */
  1097.  
  1098. XX#define BREAK        (char)  0    /* default interrupt    */
  1099. XX#define BACKSPACE    (char)  8    /* backspace character  */
  1100. XX#define TAB        (char)  9       /* tab character        */
  1101. XX#define RETURN        (char) 13    /* carriage return char */
  1102. XX#define LINE_FEED    (char) 10    /* line feed character  */
  1103. XX#define FORMFEED    (char) 12    /* form feed (^L) char  */
  1104. XX#define COMMA        ','        /* comma character      */
  1105. XX#define SPACE        ' '        /* space character      */
  1106. XX#define DOT        '.'        /* period/dot character */
  1107. XX#define BANG        '!'        /* exclaimation mark!   */
  1108. XX#define AT_SIGN        '@'        /* at-sign character    */
  1109. XX#define PERCENT        '%'        /* percent sign char.   */
  1110. XX#define COLON        ':'        /* the colon ..        */
  1111. XX#define ESCAPE        (char) 27    /* the escape        */
  1112. XX#define NO_OP_COMMAND    '\0'        /* no-op for timeouts   */
  1113.  
  1114. XX#define STANDARD_INPUT  0        /* file number of stdin */
  1115.  
  1116. XX#ifndef TRUE
  1117. XX#define TRUE        1
  1118. XX#define FALSE        0
  1119. XX#endif
  1120.  
  1121. XX#define OUTGOING    0        /* defines for lock file   */
  1122. XX#define INCOMING    1        /* creation..see lock()    */
  1123.  
  1124. XX#define SH        0        /* defines for system_call */
  1125. XX#define USER_SHELL    1        /* to work correctly!      */
  1126.  
  1127. XX#define EXECUTE_ACCESS    01        /* These five are        */
  1128. XX#define WRITE_ACCESS    02        /*    for the calls       */
  1129. XX#define READ_ACCESS    04        /*       to access()       */
  1130. XX#define ACCESS_EXISTS    00        /*           <etc>         */
  1131. XX#define EDIT_ACCESS    06        /*  (this is r+w access)   */
  1132.  
  1133. XX#define BIG_NUM        999999        /* big number!             */
  1134. XX#define BIGGER_NUM    9999999     /* bigger number!          */
  1135.  
  1136. XX#define START_ENCODE    "[encode]"
  1137. XX#define END_ENCODE    "[clear]"
  1138.  
  1139. XX#define DONT_SAVE    "[no save]"
  1140.  
  1141. XX#define alias_file    ".aliases"
  1142. XX#define group_file    ".groups"
  1143. XX#define system_file    ".systems"
  1144.  
  1145. XX/** some defines for the "status" field of the header record **/
  1146.  
  1147. XX#define TAGGED        1        /* these are bit masks */
  1148. XX#define DELETED        2
  1149. XX#define EXPIRED        4
  1150. XX#define ACTION        8
  1151. XX#define NEW        16
  1152. XX#define PRIORITY    32
  1153.  
  1154. XX/** some months... **/
  1155.  
  1156. XX#define JANUARY        0            /* months of the year */
  1157. XX#define FEBRUARY    1
  1158. XX#define MARCH        2
  1159. XX#define APRIL        3
  1160. XX#define MAY        4
  1161. XX#define JUNE        5
  1162. XX#define JULY        6
  1163. XX#define AUGUST        7
  1164. XX#define SEPTEMBER    8
  1165. XX#define OCTOBER        9
  1166. XX#define NOVEMBER    10
  1167. XX#define DECEMBER    11
  1168.  
  1169. XX#define equal(s,w)    (strcmp(s,w) == 0)
  1170. XX#define min(a,b)    a < b? a : b
  1171. XX#define ctrl(c)            c - 'A' + 1    /* control character mapping */
  1172. XX#define plural(n)    n == 1 ? "" : "s"
  1173. XX#define lastch(s)    s[strlen(s)-1]
  1174. XX#define no_ret(s)    if (lastch(s) == '\n') lastch(s) = '\0' 
  1175. XX#define first_word(s,w) (strncmp(s,w, strlen(w)) == 0)
  1176. XX#define ClearLine(n)    MoveCursor(n,0); CleartoEOLN()
  1177. XX#define whitespace(c)    (c == ' ' || c == '\t')
  1178. XX#define quote(c)    (c == '"' || c == '\'') 
  1179. XX#define onoff(n)    (n == 0 ? "OFF" : "ON")
  1180.  
  1181. XX/** The next function is so certain commands can be processed from the showmsg
  1182. XX    routine without rewriting the main menu in between... **/
  1183.  
  1184. XX#define special(c)    (c == 'j' || c == 'k')
  1185.  
  1186. XX/** and a couple for dealing with status flags... **/
  1187.  
  1188. XX#define ison(n,mask)    (n & mask)
  1189. XX#define isoff(n,mask)    (~ison(n, mask))
  1190.  
  1191. XX#define setit(n,mask)        n |= mask
  1192. XX#define clearit(n, mask)    n &= ~mask
  1193.  
  1194. XX/** a few for the usage of function keys... **/
  1195.  
  1196. XX#define f1    1
  1197. XX#define f2    2
  1198. XX#define f3    3
  1199. XX#define f4    4
  1200. XX#define f5    5
  1201. XX#define f6    6
  1202. XX#define f7    7
  1203. XX#define f8    8
  1204.  
  1205. XX#define MAIN    0
  1206. XX#define ALIAS   1
  1207. XX#define YESNO    2
  1208. XX#define CHANGE  3
  1209. XX#define READ    4
  1210.  
  1211. XX/** some possible sort styles... **/
  1212.  
  1213. XX#define REVERSE        -        /* for reverse sorting           */
  1214. XX#define SENT_DATE    1        /* the date message was sent     */
  1215. XX#define RECEIVED_DATE    2        /* the date message was received */
  1216. XX#define SENDER        3        /* the name/address of sender    */
  1217. XX#define SIZE        4        /* the # of lines of the message */
  1218. XX#define SUBJECT        5        /* the subject of the message    */
  1219. XX#define STATUS        6        /* the status (deleted, etc)     */
  1220.  
  1221. XX/* wouldn't it be nice to have variable argument macros... */
  1222.  
  1223. XX#define dprint0(n,s)         if (debug >= n) { \
  1224. XX                fprintf(debugfile, s); fflush(debugfile); }
  1225.  
  1226. XX#define dprint1(n,s,a)         if (debug >= n) { \
  1227. XX                fprintf(debugfile, s, a);  fflush(debugfile); }
  1228.  
  1229. XX#define dprint2(n,s,a,b)     if (debug >= n) { \
  1230. XX                    fprintf(debugfile, s, a, b); fflush(debugfile);}
  1231.  
  1232. XX#define dprint3(n,s,a,b,c)   if (debug >= n) { fprintf(debugfile, \
  1233. XX                s, a, b, c); fflush(debugfile); }
  1234.  
  1235. XX#define dprint4(n,s,a,b,c,d)  if (debug >= n) { fprintf(debugfile, \
  1236. XX                s, a, b, c, d); fflush(debugfile); }
  1237.  
  1238. XX#define dprint5(n,s,a,b,c,d,e) if (debug >= n) { fprintf(debugfile, \
  1239. XX                    s, a, b, c, d, e); fflush(debugfile); }
  1240.  
  1241. XX#define dprint6(n,s,a,b,c,d,e,f) if (debug >= n) { fprintf(debugfile, \
  1242. XX                    s, a, b, c, d, e, f); fflush(debugfile); }
  1243.  
  1244. XX/* I guess this corrects it, though.  Wretched stuff though! */
  1245.  
  1246. XX/* some random records... */
  1247.  
  1248. XXstruct date_rec {
  1249. XX    int  month;        /** this record stores a **/
  1250. XX    int  day;        /**   specific date and  **/
  1251. XX    int  year;        /**     time...         **/
  1252. XX    int  hour;
  1253. XX    int  minute;
  1254. XX       };
  1255.  
  1256. XXstruct header_rec {
  1257. XX    int  lines;        /** # of lines in the message  **/
  1258. XX    int  status;        /** Urgent, Deleted, Expired?  **/
  1259. XX    int  index_number;    /** relative loc in file...    **/
  1260. XX    long offset;        /** offset in bytes of message **/
  1261. XX    struct date_rec received; /** when elm received here   **/
  1262. XX    char from[STRING];    /** who sent the message?      **/
  1263. XX    char to[STRING];    /** who it was sent to           **/
  1264. XX    char dayname[8];    /**  when the                  **/
  1265. XX    char month[10];        /**        message             **/
  1266. XX    char day[3];        /**          was            **/
  1267. XX    char year[5];        /**            sent            **/
  1268. XX    char time[NLEN];    /**              to you!       **/
  1269. XX    char subject[STRING];   /** The subject of the mail    **/
  1270. XX       };
  1271.  
  1272. XXstruct alias_rec {
  1273. XX    char   name[NLEN];    /* alias name                  */
  1274. XX    long   byte;        /* offset into data file for address */
  1275. XX       };
  1276.  
  1277. XXstruct lsys_rec {
  1278. XX    char   name[NLEN];    /* name of machine connected to      */
  1279. XX    struct lsys_rec *next;    /* linked list pointer to next       */
  1280. XX       };
  1281.  
  1282. XXstruct addr_rec {
  1283. XX     char   address[NLEN];    /* machine!user you get mail as      */
  1284. XX     struct addr_rec *next;    /* linked list pointer to next       */
  1285. XX    };
  1286. @//E*O*F hdrs/defs.h//
  1287. chmod u=rw,g=r,o=r hdrs/defs.h
  1288.  
  1289. echo x - hdrs/elm.h
  1290. sed 's/^XX//' > "hdrs/elm.h" <<'@//E*O*F hdrs/elm.h//'
  1291. XX/**        elm.h            **/
  1292.  
  1293. XX/**  header file for ELM mail system.  **/
  1294.  
  1295. XX/**  (C) Copyright 1986, Dave Taylor   **/
  1296.  
  1297. XX#include <stdio.h>
  1298. XX#include <fcntl.h>
  1299.  
  1300. XX#include "../hdrs/curses.h"
  1301. XX#include "../hdrs/defs.h"
  1302.  
  1303. XX/******** static character string containing the copyright notice  *******/
  1304.  
  1305. XXstatic char copyright[] = { "(C) Copyright 1986, Dave Taylor" };
  1306.  
  1307. XX/******** and another string for the version number and so on     ********/
  1308.  
  1309. XXstatic char ident[] = { WHAT_STRING };
  1310.  
  1311. XX/******** global variables accessable by all pieces of the program *******/
  1312.  
  1313. XXint current = 0;        /* current message number  */
  1314. XXint header_page = 0;         /* current header page     */
  1315. XXint last_header_page = -1;         /* last header page        */
  1316. XXint message_count = 0;        /* max message number      */
  1317. XXint headers_per_page;        /* number of headers/page  */
  1318. XXchar infile[SLEN];        /* name of current mailbox */
  1319. XXchar hostname[SLEN];        /* name of machine we're on*/
  1320. XXchar username[SLEN];        /* return address name!    */
  1321. XXchar full_username[SLEN];    /* Full username - gecos   */
  1322. XXchar home[SLEN];        /* home directory of user  */
  1323. XXchar folders[SLEN];        /* folder home directory   */
  1324. XXchar mailbox[SLEN];        /* mailbox name if defined */
  1325. XXchar editor[SLEN];        /* editor for outgoing mail*/
  1326. XXchar printout[SLEN];        /* how to print messages   */
  1327. XXchar savefile[SLEN];        /* name of file to save to */
  1328. XXchar calendar_file[SLEN];    /* name of file for clndr  */
  1329. XXchar prefixchars[SLEN];        /* prefix char(s) for msgs */
  1330. XXchar shell[SLEN];        /* current system shell    */
  1331. XXchar pager[SLEN];        /* what pager to use       */
  1332. XXchar batch_subject[SLEN];    /* subject buffer for batchmail */
  1333.  
  1334. XXchar backspace,            /* the current backspace char */
  1335. XX     kill_line;            /* the current kill-line char */
  1336.  
  1337. XXchar up[SHORT], down[SHORT];    /* cursor control seq's    */
  1338. XXint  cursor_control = FALSE;    /* cursor control avail?   */
  1339.  
  1340. XXchar start_highlight[SHORT],
  1341. XX     end_highlight[SHORT];    /* stand out mode...       */
  1342.  
  1343. XXint  has_highlighting = FALSE;    /* highlighting available? */
  1344.  
  1345. XXchar *weedlist[MAX_IN_WEEDLIST];
  1346. XXint  weedcount;
  1347.  
  1348. XXint file_changed = 0;        /* flag: true if infile changed     */
  1349. XXint mini_menu = 1;        /* flag: menu specified?        */
  1350. XXint mbox_specified = 0;        /* flag: specified alternate mbox?  */
  1351. XXint check_first = 1;        /* flag: verify mail to be sent!    */
  1352. XXint auto_copy = 0;        /* flag: automatically copy source? */
  1353. XXint filter = 0;            /* flag: weed out header lines?        */
  1354. XXint resolve_mode = 1;        /* flag: delete saved mail?        */
  1355. XXint auto_cc = 0;        /* flag: mail copy to user?        */
  1356. XXint noheader = 0;        /* flag: copy + header to file?     */
  1357. XXint title_messages = 0;        /* flag: title message display?     */
  1358. XXint edit_outbound = 0;        /* flag: edit outbound headers?        */
  1359. XXint read_aliases = 1;        /* flag: read in alias files?        */
  1360. XXint hp_terminal = 0;        /* flag: are we on HP term?        */
  1361. XXint hp_softkeys = 0;        /* flag: are there softkeys?        */
  1362. XXint save_by_name = 0;        /* flag: save mail by login name?   */
  1363. XXint notesfile = 0;        /* flag: is input file from notes?  */
  1364. XXint mail_only = 0;        /* flag: send mail then leave?      */
  1365. XXint check_only = 0;        /* flag: check aliases then leave?  */
  1366. XXint move_when_paged = 0;    /* flag: move when '+' or '-' used? */
  1367. XXint point_to_new = 1;        /* flag: start pointing at new msg? */
  1368. XXint bounceback = 0;        /* flag: bounce copy off remote?    */
  1369. XXint signature = 0;        /* flag: include $home/.signature?  */
  1370. XXint always_leave = 0;        /* flag: always leave msgs pending? */
  1371. XXint always_del = 0;        /* flag: always delete marked msgs? */
  1372. XXint arrow_cursor = 0;        /* flag: use "->" cursor regardless?*/
  1373. XXint debug = 0;             /* flag: default is no debug!       */
  1374.  
  1375. XX#ifdef UTS
  1376. XX int isatube = 0;        /* flag: are we on an IBM 3270?     */
  1377. XX#endif
  1378.  
  1379. XXint sortby = REVERSE SENT_DATE;    /* how to sort incoming mail...     */
  1380.  
  1381. XXlong timeout = 0L;        /* timeout (secs) on main prompt    */
  1382.  
  1383. XXint mailbox_defined = 0;    /** mailbox specified?    **/
  1384.  
  1385. XXint LINES=23;            /** lines per screen      **/
  1386. XXint COLUMNS=80;            /** columns per page      **/
  1387.  
  1388. XXint size_of_pathfd;        /** size of pathfile, 0 if none **/
  1389.  
  1390. XXFILE *mailfile;            /* current mailbox file     */
  1391. XXFILE *debugfile;        /* file for debug output    */
  1392. XXFILE *pathfd;            /* path alias file          */
  1393. XXFILE *domainfd;            /* domain file            */
  1394.  
  1395. XXlong mailfile_size;        /* size of current mailfile */
  1396.  
  1397. XXstruct header_rec header_table[MAX_HEADERS];
  1398.  
  1399. XXstruct alias_rec user_hash_table[MAX_UALIASES];
  1400. XXstruct alias_rec system_hash_table[MAX_SALIASES];
  1401.  
  1402. XXstruct date_rec last_read_mail; /* last time we read mailbox  */
  1403.  
  1404. XXstruct lsys_rec *talk_to_sys;   /* what machines do we talk to? */
  1405.  
  1406. XXstruct addr_rec *alternative_addresses;    /* how else do we get mail? */
  1407.  
  1408. XXint system_files = 0;        /* do we have system aliases? */
  1409. XXint user_files = 0;        /* do we have user aliases?   */
  1410.  
  1411. XXint system_data;        /* fileno of system data file */
  1412. XXint user_data;            /* fileno of user data file   */
  1413.  
  1414. XXint userid;            /* uid for current user          */
  1415. XXint groupid;            /* groupid for current user   */
  1416. @//E*O*F hdrs/elm.h//
  1417. chmod u=rw,g=r,o=r hdrs/elm.h
  1418.  
  1419. echo x - hdrs/headers.h
  1420. sed 's/^XX//' > "hdrs/headers.h" <<'@//E*O*F hdrs/headers.h//'
  1421. XX/**        headers.h        **/
  1422.  
  1423. XX/**  header file for ELM mail system.  **/
  1424.  
  1425. XX/**  (C) Copyright 1985, Dave Taylor   **/
  1426.  
  1427. XX#include <stdio.h>
  1428. XX#include <fcntl.h>
  1429.  
  1430. XX#include "curses.h"
  1431. XX#include "defs.h"
  1432.  
  1433. XX/******** global variables accessable by all pieces of the program *******/
  1434.  
  1435. XXextern int current;        /* current message number  */
  1436. XXextern int header_page;         /* current header page     */
  1437. XXextern int last_header_page;    /* last header page        */
  1438. XXextern int message_count;    /* max message number      */
  1439. XXextern int headers_per_page;    /* number of headers/page  */
  1440. XXextern char infile[SLEN];    /* name of current mailbox */
  1441. XXextern char hostname[SLEN];    /* name of machine we're on*/
  1442. XXextern char username[SLEN];    /* return address name!    */
  1443. XXextern char full_username[SLEN];/* Full username - gecos   */
  1444. XXextern char home[SLEN];        /* home directory of user  */
  1445. XXextern char folders[SLEN];    /* folder home directory   */
  1446. XXextern char mailbox[SLEN];    /* mailbox name if defined */
  1447. XXextern char editor[SLEN];    /* default editor for mail */
  1448. XXextern char printout[SLEN];    /* how to print messages   */
  1449. XXextern char savefile[SLEN];    /* name of file to save to */
  1450. XXextern char calendar_file[SLEN];/* name of file for clndr  */
  1451. XXextern char prefixchars[SLEN];    /* prefix char(s) for msgs */
  1452. XXextern char shell[SLEN];    /* default system shell    */
  1453. XXextern char pager[SLEN];    /* what pager to use...    */
  1454. XXextern char batch_subject[SLEN];/* subject buffer for batchmail */
  1455.  
  1456. XXextern char backspace,        /* the current backspace char  */
  1457. XX        kill_line;        /* the current kill_line char  */
  1458.  
  1459. XXextern char up[SHORT], 
  1460. XX        down[SHORT];    /* cursor control seq's    */
  1461. XXextern int  cursor_control;    /* cursor control avail?   */
  1462.  
  1463. XXextern char start_highlight[SHORT],
  1464. XX        end_highlight[SHORT];  /* standout mode... */
  1465.  
  1466. XXextern int  has_highlighting;    /* highlighting available? */
  1467.  
  1468. XX/** the following two are for arbitrary weedout lists.. **/
  1469.  
  1470. XXextern char *weedlist[MAX_IN_WEEDLIST];
  1471. XXextern int  weedcount;        /* how many headers to check?        */
  1472.  
  1473. XXextern int  file_changed;    /* flag: true iff infile changed      */
  1474. XXextern int  mini_menu;        /* flag: display menu?               */
  1475. XXextern int  mbox_specified;     /* flag: specified alternate mailbox? */
  1476. XXextern int  check_first;    /* flag: verify mail to be sent!      */
  1477. XXextern int  auto_copy;        /* flag: auto copy source into reply? */
  1478. XXextern int  filter;        /* flag: weed out header lines?          */
  1479. XXextern int  resolve_mode;    /* flag: resolve before moving mode?  */
  1480. XXextern int  auto_cc;        /* flag: mail copy to yourself?       */
  1481. XXextern int  noheader;        /* flag: copy + header to file?       */
  1482. XXextern int  title_messages;    /* flag: title message display?       */
  1483. XXextern int  edit_outbound;    /* flag: edit outbound headers?       */
  1484. XXextern int  read_aliases;    /* flag: read in alias files??          */
  1485. XXextern int  hp_terminal;    /* flag: are we on an hp terminal?    */
  1486. XXextern int  hp_softkeys;    /* flag: are there softkeys?          */
  1487. XXextern int  save_by_name;      /* flag: save mail by login name?     */
  1488. XXextern int  notesfile;        /* flag: is input file from notes?    */
  1489. XXextern int  mail_only;        /* flag: send mail then leave?        */
  1490. XXextern int  check_only;        /* flag: check aliases and leave?     */
  1491. XXextern int  move_when_paged;    /* flag: move when '+' or '-' used?   */
  1492. XXextern int  point_to_new;    /* flag: start pointing at new msgs?  */
  1493. XXextern int  bounceback;        /* flag: bounce copy off remote?      */
  1494. XXextern int  signature;        /* flag: include $home/.signature?    */
  1495. XXextern int  always_leave;    /* flag: always leave mail pending?   */
  1496. XXextern int  always_del;        /* flag: always delete marked msgs?   */
  1497. XXextern int  arrow_cursor;    /* flag: use "->" regardless?          */
  1498. XXextern int  debug;        /* flag: debugging mode on?           */
  1499.  
  1500. XX#ifdef UTS
  1501. XXextern int  isatube;        /* flag: are we on an IBM 3270 tube?  */
  1502. XX#endif
  1503.  
  1504. XXextern int  sortby;        /* how to sort mailboxes          */
  1505.  
  1506. XXextern long timeout;        /* seconds for main level timeout     */
  1507.  
  1508. XXextern int mailbox_defined;    /** specified mailbox?  **/
  1509.  
  1510. XXextern int LINES;        /** lines per screen    **/
  1511. XXextern int COLUMNS;        /** columns per line    **/
  1512.  
  1513. XXextern int size_of_pathfd;    /** size of pathfile, 0 if none **/
  1514.  
  1515. XXextern FILE *mailfile;        /* current mailbox file     */
  1516. XXextern FILE *debugfile;        /* file for debut output    */
  1517. XXextern FILE *pathfd;        /* path alias file          */
  1518. XXextern FILE *domainfd;        /* domains file         */
  1519.  
  1520. XXextern long mailfile_size;    /* size of current mailfile */
  1521.  
  1522. XXextern struct header_rec header_table[MAX_HEADERS];
  1523.  
  1524. XXextern struct alias_rec user_hash_table  [MAX_UALIASES];
  1525. XXextern struct alias_rec system_hash_table[MAX_SALIASES];
  1526.  
  1527. XXextern struct date_rec last_read_mail;
  1528.  
  1529. XXextern struct lsys_rec *talk_to_sys;    /* who do we talk to? */
  1530.  
  1531. XXextern struct addr_rec *alternative_addresses;    /* how else do we get mail? */
  1532.  
  1533. XXextern int system_files;    /* do we have system aliases? */
  1534. XXextern int user_files;        /* do we have user aliases?   */
  1535.  
  1536. XXextern int system_data;        /* fileno of system data file */
  1537. XXextern int user_data;        /* fileno of user data file   */
  1538.  
  1539. XXextern int userid;        /* uid for current user          */
  1540. XXextern int groupid;        /* groupid for current user   */
  1541. @//E*O*F hdrs/headers.h//
  1542. chmod u=rw,g=r,o=r hdrs/headers.h
  1543.  
  1544. echo x - hdrs/help.h
  1545. sed 's/^XX//' > "hdrs/help.h" <<'@//E*O*F hdrs/help.h//'
  1546. XX    case '!': s = 
  1547. XX           "Escape to the Unix shell of your choice, or just to enter commands";
  1548. XX       break;
  1549. XX    case '@': s = 
  1550. XX       "Debug - display a summary of the notes on the header page";
  1551. XX       break;
  1552. XX    case '|': s = 
  1553. XX     "Pipe the current message or tagged messages to the command specified";
  1554. XX       break;
  1555. XX    case '#': s = 
  1556. XX      "Debug - display all information known about current message";
  1557. XX      break;
  1558. XX    case '%': s = 
  1559. XX           "Debug - display the computed return address of the current message";
  1560. XX       break;
  1561. XX    case '*': s = "Go to the last message in the current mailbox";
  1562. XX       break;
  1563. XX    case '-': s = 
  1564. XX       "Go to the previous page of messages in the current mailbox";
  1565. XX       break;
  1566. XX    case '=': s = "Go to the first message in the current mailbox";
  1567. XX       break;
  1568. XX    case ' ': s = "Go to the next page of messages in the current mailbox";
  1569. XX       break;
  1570. XX    case '+': s = "Go to the next page of messages in the current mailbox";
  1571. XX       break;
  1572. XX    case '/': s = "Search for specified pattern in mailbox";
  1573. XX       break;
  1574. XX    case '<': s = "Scan current message for calendar entries (if enabled)";
  1575. XX       break;
  1576. XX    case '>': s = 
  1577. XX       "Save current message or tagged messages to specified file";
  1578. XX       break;
  1579. XX    case '^': s = 
  1580. XX       "Toggle the Delete/Undelete status of the current message";
  1581. XX       break;
  1582. XX    case 'a': s = 
  1583. XX       "Enter the alias sub-menu section.  Create and display aliases";
  1584. XX       break;
  1585. XX    case 'b': s = 
  1586. XX       "Bounce (remail) a message to someone as if you have never seen it";
  1587. XX       break;
  1588. XX    case 'c': s = 
  1589. XX       "Change mailboxes, leaving the current mailbox as if 'quitting'";
  1590. XX       break;
  1591. XX    case 'd': s = "Mark the current message for future deletion";
  1592. XX       break;
  1593. XX    case 'e': s = 
  1594. XX           "Invoke the editor on the entire mailbox, resync'ing when done";
  1595. XX       break;
  1596. XX    case 'f': s = 
  1597. XX           "Forward the current message to someone, return address is yours";
  1598. XX       break;
  1599. XX    case 'g': s = 
  1600. XX         "Group reply not only to the sender, but to everyone who received msg";
  1601. XX       break;
  1602. XX    case 'h': s = "Display message with all Headers (ignore weedout list)";
  1603. XX       break;
  1604. XX    case 'j': s = 
  1605. XX           "Go to the next message.  This is the same as the DOWN arrow";
  1606. XX       break;
  1607. XX    case 'k': s = 
  1608. XX           "Go to the previous message.  This is the same as the UP arrow";
  1609. XX       break;
  1610. XX    case 'm': s = 
  1611. XX           "Create and send mail to the specified person or persons";
  1612. XX       break;
  1613. XX    case 'n': s = 
  1614. XX           "Read the current message, then move current to next messge";
  1615. XX       break;
  1616. XX    case 'o': s = "Go to the options submenu";
  1617. XX       break;
  1618. XX    case 'p': s = "Print the current message or the tagged messages";
  1619. XX       break;
  1620. XX    case 'q': s = "Quit the mailer, asking about deletion, saving, etc";
  1621. XX       break;
  1622. XX    case 'r': s = 
  1623. XX      "Reply to the message.  This only sends to the originator of the message";
  1624. XX       break;
  1625. XX    case 's': s = 
  1626. XX           "Save current message or tagged messages to specified file";
  1627. XX       break;
  1628. XX    case 't': s = 
  1629. XX           "Tag a message for further operations (or untag if tagged)";
  1630. XX       break;
  1631. XX    case 'u': s = "Undelete - remove the deletion mark on the message";
  1632. XX       break;
  1633. XX    case 'x': s = "Exit the mail system quickly";
  1634. XX       break;
  1635. XX    
  1636. XX    case '\n':
  1637. XX    case '\r': s = "Read the current message";
  1638. XX       break;
  1639.  
  1640. XX    case ctrl('L'): s = "Rewrite the screen";    
  1641. XX       break;
  1642. XX        case ctrl('?'):                        /* DEL */
  1643. XX    case ctrl('Q'): s = "Exit the mail system quickly";
  1644. XX       break;
  1645. XX    default : 
  1646. XX    
  1647. XX        /** first off, is it a digit the user entered?? **/
  1648.  
  1649. XX              if (isdigit(ch)) 
  1650. XX                s = "Make specified number the current message";
  1651. @//E*O*F hdrs/help.h//
  1652. chmod u=rw,g=rw,o=rw hdrs/help.h
  1653.  
  1654. echo x - hdrs/sysdefs.h
  1655. sed 's/^XX//' > "hdrs/sysdefs.h" <<'@//E*O*F hdrs/sysdefs.h//'
  1656.  
  1657. XX/**            sysdefs.h            **/
  1658.  
  1659. XX/**  System level, configurable, defines for the ELM mail system.  **/
  1660.  
  1661. XX/**  (C) Copyright 1986 Dave Taylor                                **/
  1662.  
  1663. XX/** define the following if you think that the information in messages
  1664. XX    that have "Reply-To:" and/or "From:" fields with addresses will
  1665. XX    contain valid addressing information.  If this isn't defined, the
  1666. XX    calculated return address will ALWAYS be used instead.  (note that
  1667. XX    this doesn't necessarily preclude the use of G)roup replies).
  1668.  
  1669. XX#define USE_EMBEDDED_ADDRESSES    
  1670.  
  1671. XX**/
  1672.  
  1673. XX#define FIND_DELTA    10        /* byte region where the binary search
  1674. XX                       on the path alias file is fruitless 
  1675. XX                                           (can't be within this boundary)    */
  1676.  
  1677. XX#define MAX_HEADERS    500    /* max number of messages in one file!   */    
  1678. XX#define MAX_SALIASES    503    /* number of system aliases allowed      */
  1679. XX#define MAX_UALIASES    251    /* number of user aliases allowed      */
  1680. XX#define MAX_IN_WEEDLIST 50    /* max headers to weed out               */
  1681.  
  1682. XX#define MAX_HOPS    35    /* max hops in return addr to E)veryone  */
  1683.  
  1684. XX#define MAX_ATTEMPTS    6    /* #times to attempt lock file creation */
  1685.  
  1686. XX/** see leavembox.c to determine if this should be defined or not....The 
  1687. XX    default is to NOT have it defined.
  1688.  
  1689. XX#define REMOVE_AT_LAST
  1690.  
  1691. XX**/
  1692.  
  1693. XX#define DEFAULT_BATCH_SUBJECT  "no subject (file transmission)"
  1694.  
  1695. XX/** If you want to have the mailer know about valid mailboxes on the
  1696. XX    host machine (assumes no delivery agent aliases) then you should
  1697. XX    undefine this (the default is to have it defined)...
  1698.  
  1699.  
  1700. XX#define NOCHECK_VALIDNAME
  1701.  
  1702. XX**/
  1703.  
  1704. XX/** If your machine doesn't have virtual memory (specifically the vfork() 
  1705. XX    command) then you should define the following....        
  1706.  
  1707. XX#define NO_VM
  1708.  
  1709. XX**/
  1710.  
  1711. XX/** If you want the mailer to check the pathalias database BEFORE it
  1712. XX    looks to see if a specified machine is in the L.sys database (in
  1713. XX    some cases routing is preferable to direct lines) then you should
  1714. XX    define the following...
  1715.  
  1716. XX#define LOOK_CLOSE_AFTER_SEARCH
  1717.  
  1718. XX**/
  1719.  
  1720. XX/** If you'd rather the program automatically used the 'uuname' command
  1721. XX    to figure out what machines it talks to (instead of trying to get
  1722. XX    it from L.sys first) then define the following...
  1723.  
  1724. XX#define USE_UUNAME
  1725.  
  1726. XX**/
  1727.  
  1728. XX/** If you'd like "newmail" to automatically go into background when you
  1729. XX    start it up (instead of the "newmail &" junk with the process id output,
  1730. XX    then define the following...
  1731.  
  1732. XX#define AUTO_BACKGROUND
  1733.  
  1734. XX**/
  1735.  
  1736. XX/** If you'd rather your mail transport agent (ie sendmail) put the From:
  1737. XX    line into the message, define the following...
  1738.  
  1739.  
  1740. XX#define DONT_ADD_FROM
  1741.  
  1742. XX**/
  1743.  
  1744. XX/** If your machine prefers the Internet notation of user@host for the
  1745. XX    From: line and addresses, define the following...(the default is to 
  1746. XX    use this rather than the USENET notation - check your pathalias file!)
  1747.  
  1748. XX#define INTERNET_ADDRESS_FORMAT
  1749.  
  1750. XX**/
  1751.  
  1752. XX/** If you're on a machine that prefers UUCP to Internet addresses, then
  1753. XX    define the following (the basic change is that on a machine that
  1754. XX    receives messages of the form <path>!user@<localhost> the displayed
  1755. XX    address will be <path>!user instead of user@<localhost>.
  1756.  
  1757. XX    BOGUS_INTERNET is the address that your local system appends to 
  1758. XX    messages occasionally.  The algorithm is simply to REMOVE the
  1759. XX    BOGUS_INTERNET string.  This is horrible.  *sigh*
  1760.  
  1761. XX#define PREFER_UUCP
  1762. XX#define BOGUS_INTERNET    "@hplabs.HP.COM"
  1763.  
  1764. XX**/
  1765.  
  1766. XX/** If you're running ACSNET and/or want to have your domain name
  1767. XX    attached to your hostname on outbound mail then you can define
  1768. XX    the following (default are not defined)
  1769.  
  1770. XX#define USE_DOMAIN
  1771. XX#define DOMAIN        "<enter your domain here>"
  1772.  
  1773. XX**/
  1774.  
  1775. XX/** If you are going to be running the mailer with setgid mail (or
  1776. XX    something similar) you'll need to define the following to ensure
  1777. XX    that the users mailbox in the spool directory has the correct
  1778. XX    group (NOT the users group)
  1779. XX**/
  1780.  
  1781. XX#define SAVE_GROUP_MAILBOX_ID
  1782.  
  1783. XX/**
  1784. XX**/
  1785.  
  1786. XX/** If you want a neat feature that enables scanning of the message
  1787. XX    body for entries to add to the users ".calendar" (or whatever)
  1788. XX    file, define this.
  1789. XX**/
  1790.  
  1791. XX#define ENABLE_CALENDAR
  1792. XX#define dflt_calendar_file    "calendar"    /* in HOME directory */
  1793.  
  1794. XX/**
  1795. XX**/
  1796.  
  1797. XX#define NOTES_HEADER        "/***** "
  1798. XX#define NOTES_FOOTER        "/* ---------- */"
  1799.  
  1800. XX#ifdef BSD
  1801. XX# define system_hash_file    "/usr/spool/mail/.alias_hash"
  1802. XX# define system_data_file    "/usr/spool/mail/.alias_data"
  1803. XX#else
  1804. XX# define system_hash_file    "/usr/mail/.alias_hash"
  1805. XX# define system_data_file    "/usr/mail/.alias_data"
  1806. XX#endif
  1807.  
  1808. XX#define pathfile        "/usr/lib/nmail.paths"
  1809. XX#define domains            "/usr/lib/domains"
  1810.  
  1811. XX#define Lsys            "/usr/lib/uucp/L.sys"
  1812.  
  1813. XX/** where to put the output of the elm -d command... (in home dir) **/
  1814. XX#define DEBUG        "ELM:debug.info"
  1815.  
  1816. XX#define temp_file    "/tmp/snd."
  1817. XX#define temp_mbox    "/tmp/mbox."
  1818. XX#define temp_print      "/tmp/print."
  1819. XX#define mailtime_file    ".last_read_mail"
  1820. XX#define readmsg_file    ".readmsg"
  1821. XX#define signature_file    ".signature"
  1822.  
  1823. XX#ifdef BSD
  1824. XX# define default_editor    "/usr/ucb/vi"
  1825. XX# define mailhome    "/usr/spool/mail/"
  1826. XX# define default_pager    "/usr/ucb/page"
  1827. XX#else
  1828. XX# define default_editor    "/usr/bin/vi"
  1829. XX# define mailhome    "/usr/mail/"
  1830. XX# define default_pager    "/usr/bin/more"
  1831. XX#endif
  1832.  
  1833. XX#define sendmail    "/usr/lib/sendmail"
  1834. XX#define smflags        "-oi"
  1835. XX#define mailer        "/bin/rmail"
  1836. XX#define mailx        "/usr/bin/mailx"
  1837.  
  1838. XX#define cutfile        "/usr/local/bin/cutfile"
  1839.  
  1840. XX#define helphome    "/usr/local/lib"
  1841. XX#define helpfile    "elm-help.main"
  1842.  
  1843. XX#define elmrcfile    "/.elmrc"
  1844. XX#define mailheaders    ".elmheaders"
  1845. XX#define unedited_mail    "emergency.mbox"
  1846. XX#define newalias    "newalias -q 1>&2 > /dev/null"
  1847. XX#define readmsg        "readmsg"
  1848. XX#define printmail    "printmail"
  1849.  
  1850. XX#define remove        "/bin/rm -f"        /* how to remove a file */
  1851. XX#define cat        "/bin/cat"        /* how to display files */
  1852. XX#define uuname        "uuname"        /* how to get a uuname  */
  1853.  
  1854.  
  1855. XX/** -- end of file sysdefsh. -- **/
  1856.  
  1857. @//E*O*F hdrs/sysdefs.h//
  1858. chmod u=rw,g=rw,o=rw hdrs/sysdefs.h
  1859.  
  1860. echo Inspecting for damage in transit...
  1861. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  1862. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  1863. cat > $temp <<\!!!
  1864.      874    4393   25463 Users.guide
  1865.      127     456    2788 elm.1
  1866.       27      54     620 curses.h
  1867.      209    1034    6693 defs.h
  1868.      125     777    4889 elm.h
  1869.      120     748    5082 headers.h
  1870.      105     558    3466 help.h
  1871.      201     794    5805 sysdefs.h
  1872.     1788    8814   54806 total
  1873. !!!
  1874. wc  doc/Users.guide doc/elm.1 hdrs/curses.h hdrs/defs.h hdrs/elm.h hdrs/headers.h hdrs/help.h hdrs/sysdefs.h | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  1875. if test -s $dtemp
  1876. then echo "Ouch [diff of wc output]:" ; cat $dtemp
  1877. else echo "No problems found."
  1878. fi
  1879. exit 0
  1880.